package com.huaxia.day9;

public class StringObj {

    /**
     * @param args 对象池的概念 string ， Integer 中使用较多的值 128以内
     *             == equals的区别
     *             equals属于object，可以重写比较逻辑
     */
    public static void main(String[] args) {
        String a = "hello";
        String b = "hello"; // 隐式创建了string对象
        String c = "he" + "llo";
        String d = new String("hello");

        System.out.println(a == b);
        System.out.println(a == c);
        System.out.println(a == d);

        System.out.println(a.equals(b));
        System.out.println(a.equals(c));
        System.out.println(a.equals(d));
    }
}
